Table of Contents Previous Section

Main.wos

The script associated with the first (and in this example, only) page of the Visitors application is Main.wos. This script increments the number of visitors to the page (visitorNum), and assigns the name (aName) entered in the application's text field to the last visitor (lastVisitor). It then clears the text field by assigning an empty string to aName.

id number, aName;

- awake {
   if (!number) {
    number = [WOApp visitorNum];
    number++;
    [WOApp setVisitorNum:number];
  }
  return self;
}
- recordMe
{  
  [WOApp setLastVisitor:aName];  
  [self setAName:@""];          // clear the text field
}

Table of Contents Next Section